﻿using Abp.Application.Navigation;
using Abp.Localization;
using MyCompanyName.AbpZeroTemplate.Authorization;
using MyCompanyName.AbpZeroTemplate.Web.Navigation;

namespace MyCompanyName.AbpZeroTemplate.Web.Areas.Mpa.Startup
{
    public class MpaNavigationProvider : NavigationProvider
    {
        public const string MenuName = "Mpa";

        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("Main Menu"));

            menu
                .AddItem(new MenuItemDefinition(
                    PageNames.App.Host.Tenants,
                    L("Tenants"),
                    url: "Mpa/Tenants",
                    icon: "icon-globe",
                    requiredPermissionName: AppPermissions.Pages_Tenants
                    )
                ).AddItem(new MenuItemDefinition(
                    PageNames.App.Host.Editions,
                    L("Editions"),
                    url: "Mpa/Editions",
                    icon: "icon-grid",
                    requiredPermissionName: AppPermissions.Pages_Editions
                    )
                ).AddItem(new MenuItemDefinition(
                    PageNames.App.Tenant.Dashboard,
                    L("Dashboard"),
                    url: "Mpa/Dashboard",
                    icon: "icon-home",
                    requiredPermissionName: AppPermissions.Pages_Tenant_Dashboard
                    )
                ).AddItem(new MenuItemDefinition(
                    PageNames.App.Common.Administration,
                    L("Administration"),
                    icon: "icon-wrench"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Common.OrganizationUnits,
                        L("OrganizationUnits"),
                        url: "Mpa/OrganizationUnits",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_Administration_OrganizationUnits
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Common.Roles,
                        L("Roles"),
                        url: "Mpa/Roles",
                        icon: "icon-briefcase",
                        requiredPermissionName: AppPermissions.Pages_Administration_Roles
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Common.Users,
                        L("Users"),
                        url: "Mpa/Users",
                        icon: "icon-users",
                        requiredPermissionName: AppPermissions.Pages_Administration_Users
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Common.Languages,
                        L("Languages"),
                        url: "Mpa/Languages",
                        icon: "icon-flag",
                        requiredPermissionName: AppPermissions.Pages_Administration_Languages
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Common.AuditLogs,
                        L("AuditLogs"),
                        url: "Mpa/AuditLogs",
                        icon: "icon-lock",
                        requiredPermissionName: AppPermissions.Pages_Administration_AuditLogs
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Host.Maintenance,
                        L("Maintenance"),
                        url: "Mpa/Maintenance",
                        icon: "icon-wrench",
                        requiredPermissionName: AppPermissions.Pages_Administration_Host_Maintenance
                        )
                    )
                    .AddItem(new MenuItemDefinition(
                        PageNames.App.Host.Settings,
                        L("Settings"),
                        url: "Mpa/HostSettings",
                        icon: "icon-settings",
                        requiredPermissionName: AppPermissions.Pages_Administration_Host_Settings
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Tenant.Settings,
                        L("Settings"),
                        url: "Mpa/Settings",
                        icon: "icon-settings",
                        requiredPermissionName: AppPermissions.Pages_Administration_Tenant_Settings
                        )
                    )
                ).AddItem(new MenuItemDefinition(//代理商
                    PageNames.App.AgentManager.Agent,
                    L("Agent"),
                    icon: "icon-user"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.AgentManager.AgentList,
                        L("AgentList"),
                        url: "Mpa/Agent/AgentList",
                        icon: "icon-user",
                        requiredPermissionName: AppPermissions.Pages_Agent_List//代理商列表
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.AgentManager.AgentTransfer,
                        L("AgentTransfer"),
                        url: "Mpa/Agent/AgentTransfer",
                        icon: "icon-note",
                        requiredPermissionName: AppPermissions.Pages_Agent_Transfer//代理商转账
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.AgentManager.AgentTransferList,
                        L("AgentTransferList"),
                        url: "Mpa/Agent/AgentTransferList",
                        icon: "icon-feed",
                        requiredPermissionName: AppPermissions.Pages_Agent_TransferList//代理商转账记录
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.AgentManager.AgentRecharge,
                        L("AgentRecharge"),
                        url: "Mpa/Agent/AgentRecharge",
                        icon: "icon-notebook",
                        requiredPermissionName: AppPermissions.Pages_Agent_Recharge//代理商充值
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.AgentManager.AgentRechargeList,
                        L("AgentRechargeList"),
                        url: "Mpa/Agent/AgentRechargeList",
                        icon: "icon-wallet",
                        requiredPermissionName: AppPermissions.Pages_Agent_RechargeList//代理商充值记录
                        )
                    )
                 ).AddItem(new MenuItemDefinition(//产品
                    PageNames.App.ProductManager.Product,
                    L("Product"),
                    icon: "icon-layers"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.ProductManager.ProductList,
                        L("ProductList"),
                        url: "Mpa/Product/ProductList",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_Product_List
                        )
                    )
                 ).AddItem(new MenuItemDefinition(//卡片
                    PageNames.App.CardManager.Card,
                    L("Card"),
                    icon: "fa fa-server"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.CardManager.CardList,
                        L("CardList"),
                        url: "Mpa/Card/CardList",
                        icon: "fa fa-server",
                        requiredPermissionName: AppPermissions.Pages_Card_List//卡片列表
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.CardManager.TransferCard,
                        L("TransferCard"),
                        url: "Mpa/Card/TransferCard",
                        icon: "icon-social-dribbble",
                        requiredPermissionName: AppPermissions.Pages_Card_TransferCard//批量划卡
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.CardManager.TransferCardLog,
                        L("TransferCardLog"),
                        url: "Mpa/Card/TransferCardLog",
                        icon: "icon-feed",
                        requiredPermissionName: AppPermissions.Pages_Card_TransferCardLog//批量划卡
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.CardManager.RechargeCard,
                        L("RechargeCard"),
                        url: "Mpa/Card/RechargeCard",
                        icon: "icon-note",
                        requiredPermissionName: AppPermissions.Pages_Card_RechardeCard//卡片充值
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.CardManager.RechargeLog,
                        L("RechargeLog"),
                        url: "Mpa/Card/RechargeLog",
                        icon: "icon-wallet",
                        requiredPermissionName: AppPermissions.Pages_Card_RechardeLog//卡片充值记录
                        )
                    )
                 ).AddItem(new MenuItemDefinition(//运营中心
                    PageNames.App.OperateCenter.Center,
                    L("OperateCenter"),
                    icon: "icon-wallet"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.OperateCenter.DailyReport,
                        L("OperateDailyReport"),
                        url: "Mpa/OperateCenter/OperateDailyReport",
                        icon: "icon-feed",
                        requiredPermissionName: AppPermissions.Pages_Operate_DailyReport//卡片日用量
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.OperateCenter.MonthReports,
                        L("OperateMonthReports"),
                        url: "Mpa/OperateCenter/OperateMonthReports",
                        icon: "icon-notebook",
                        requiredPermissionName: AppPermissions.Pages_Operate_MonthReports//卡片月用量
                        )
                    )
                 ).AddItem(new MenuItemDefinition(//系统
                    PageNames.App.SystemManager.System,
                    L("System"),
                    icon: "icon-social-dribbble"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.SystemManager.SystemSetting,
                        L("SystemSetting"),
                        url: "Mpa/System/index",
                        icon: "icon-social-dribbble",
                        requiredPermissionName: AppPermissions.Pages_System_Setting
                        )
                    )
                 )
                 //.AddItem(new MenuItemDefinition(//配置
                 //   PageNames.App.ConfigManager.Config,
                 //   L("Config"),
                 //   icon: "icon-wrench"
                 //   ).AddItem(new MenuItemDefinition(
                 //       PageNames.App.ConfigManager.ConfigSetting,
                 //       L("ConfigSetting"),
                 //       url: "Mpa/Config/Index",
                 //       icon: "icon-layers",
                 //       requiredPermissionName: AppPermissions.Pages_Config_Setting
                 //       )
                 //   )
                 //)
                 ;

        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, AbpZeroTemplateConsts.LocalizationSourceName);
        }
    }
}